<script type="text/html" id="barDemo">
    {foreach $right as $value}
    {if $value['type']=='detail'}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail" action="{$value['action']}">{$value['desc']}</a>
    {elseif $value['type']=='edit'}
    <a class="layui-btn layui-btn-xs" lay-event="edit" action="{$value['action']}">{$value['desc']}</a>
    {elseif $value['type']=='del'}
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"  action="{$value['action']}?cid={{d.cid}}&model_id={{d.model_id}}">{$value['desc']}</a>
    {elseif $value['type']=='a'}
    <a class="layui-btn layui-btn-xs" href="{$value['action']}?id={{d.id}}">{$value['desc']}</a>
    {elseif $value['type']=='addchild'}
    <a class="layui-btn layui-btn-xs" lay-event="addchild" action="{$value['action']}">{$value['desc']}</a>
    {elseif $value['type']=='button'}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="button"  action="{$value['action']}?cid={{d.cid}}&model_id={{d.model_id}}">{$value['desc']}</a>
    {/if}
    {/foreach}
</script>